package com.zenithmind.task.pojo.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zenithmind.common.query.BaseQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 任务查询条件类
 *
 * @author ZenithMind Team
 * @since 2025-01-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "任务查询参数")
public class TaskQuery extends BaseQuery {

    @Schema(description = "任务标题（模糊查询）")
    private String title;

    @Schema(description = "任务描述（模糊查询）")
    private String description;

    @Schema(description = "任务状态列表")
    private List<Integer> statusList;

    @Schema(description = "优先级列表")
    private List<Integer> priorityList;

    @Schema(description = "任务类型列表")
    private List<Integer> taskTypeList;

    @Schema(description = "分类ID列表")
    private List<String> categoryIds;

    @Schema(description = "标签列表")
    private List<String> tags;

    @Schema(description = "创建者ID列表")
    private List<String> creatorIds;

    @Schema(description = "负责人ID列表")
    private List<String> assigneeIds;

    @Schema(description = "项目ID列表")
    private List<String> projectIds;

    @Schema(description = "父任务ID")
    private String parentId;

    @Schema(description = "是否查询子任务")
    private Boolean includeSubtasks;

    @Schema(description = "计划开始时间-开始")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime plannedStartTimeBegin;

    @Schema(description = "计划开始时间-结束")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime plannedStartTimeEnd;

    @Schema(description = "计划结束时间-开始")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime plannedEndTimeBegin;

    @Schema(description = "计划结束时间-结束")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime plannedEndTimeEnd;

    @Schema(description = "创建时间-开始")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeBegin;

    @Schema(description = "创建时间-结束")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeEnd;

    @Schema(description = "进度范围-最小值")
    private Integer progressMin;

    @Schema(description = "进度范围-最大值")
    private Integer progressMax;

    @Schema(description = "是否重要")
    private Boolean isImportant;

    @Schema(description = "是否紧急")
    private Boolean isUrgent;

    @Schema(description = "是否逾期")
    private Boolean isOverdue;

    @Schema(description = "是否有附件")
    private Boolean hasAttachment;

    @Schema(description = "是否有评论")
    private Boolean hasComment;

    @Schema(description = "是否已关注")
    private Boolean isFollowed;

    @Schema(description = "关键词搜索（标题和描述）")
    private String keyword;

    @Schema(description = "高级搜索条件（JSON格式）")
    private String advancedSearch;
}
